package com.zhaoyu.utils.threadlocal;

/**
 * 使用过滤器解析后的用户需要放在当前线程中
 */
public class AdminThreadLocalUtils {

    private final static ThreadLocal<Integer> userThreadLocal = new ThreadLocal<>();

    /**
     * 设置当前线程中的用户Id(AdUser)
     */
    public static void setUser(Integer adUserId){
        userThreadLocal.set(adUserId);
    }

    /**
     * 获取线程中的用户Id(AdUser)
     */
    public static Integer getUser( ){
        return userThreadLocal.get();
    }

}